1. Field of the Invention
This invention relates to a memory system and a control method thereof and more particularly to a memory system having an electrically rewritable flash memory.
2. Description of the Related Art
As one of electrically rewritable (reprogrammable) nonvolatile semiconductor memories, a NAND flash memory is known. In the NAND flash memory, information is recorded according to a potential of a control gate (that is hereinafter simply referred to as a potential of a cell) by changing the potential by injection of electrons when the channel of a recorded cell is changed from a cutoff state to a conductive state.
However, the cell potential is gradually lowered as charges are extracted from the floating gate when a long time has elapsed after recording. Then, if the potential becomes lower than the threshold value of the potential for determination of recording data, data is shifted to an adjacent threshold level. Further, the potentials of some cells may rise due to charges being introduced into the floating gate itself or an insulating layer surrounding the floating gate during the operation. Also, in this case, a threshold value between the effective potential width of data originally recorded in the cell and the effective potential width adjacent to the above effective potential width on the higher-potential side is exceeded and, as a result, data will be shifted. Since the above two phenomena are phenomena that can occur, it is necessary to prepare a mechanism that prevents data from being shifted even when one of the phenomena occurs.
Conventionally, a redundant area is provided in addition to a user area in which user data is recorded, and an error correction code or the like is recorded in the redundant area. Then, the above two data shifts are grasped as phenomena by use of the error correction code and a correct data string is obtained by correcting them. Further, user data is prevented from being lost by copying data of a block in which a data shift has occurred into another block. However, in order to make it possible to use a copy-source block in which the data shift has occurred again, it is necessary to erase the data. Since the erase operation reduces the life of the NAND flash memory, it is desirable to avoid the erase operation as far as possible.
As another method for coping with the above problem, a process for performing a program cycle again only for a cell to set the potential of a cell to a lower limit VFx as a target when the potential of the cell is lowered and becomes lower than VFx to which the cell potential should be set and temporarily copying user data into a buffer, erasing block data and writing back data from the buffer to the block when the cell potential exceeds an upper limit VAx to which the cell potential should be set, that is, the technique for refreshing, is disclosed in Jpn. Pat. Appln. KOKAI Publication No. H11-154394. However, even if this method is applied, a data reprogramming operation must be performed when the cell potential gradually rises, which is not desirable in suppressing the number of data reprogramming operations.
Further, in any one of the above techniques, since a fixed potential is used to determine a data rank to which the potential of a cell belongs, the potential rise or drop only has a margin that is substantially equal to half the potential rank range. Therefore, the determination cannot be made based on the characteristics of a flash memory in which the potential strongly tends to drop, therefore a flash memory in which the potential strongly tends to rise and a data shift will be caused in an early stage.